package edu.ufop.vaadin.helloworld.controller;

import edu.ufop.vaadin.helloworld.dao.LoginDao;
import edu.ufop.vaading.helloworld.model.User;


public class LoginController {
	
	private static boolean isValid;
	
	public static boolean isValidUser(User usr)
	{
		LoginDao lDao=new LoginDao();
		
		//if user does not exist into the target database, return false
		// Validate username and password with database here. For examples sake
				// I use a dummy username and password.
		//It is necessary to implement LoginDAO
		
		isValid = lDao.findUser(usr.getEmail(), usr.getPassword());	
		//if user does exist into the database, return true
		return isValid;
		
	}
	
}

